//
//  UIView+Frame.m
//  baisibudejie
//
//  Created by renwei on 16/9/18.
//  Copyright © 2016年 renwei. All rights reserved.
//

#import "UIView+Frame.h"

@implementation UIView (Frame)

- (void)setRw_height:(CGFloat)rw_height {

    CGRect rect = self.frame;
    rect.size.height = rw_height;
    self.frame = rect;
}

- (CGFloat)rw_height {

    return self.frame.size.height;
}

- (void)setRw_width:(CGFloat)rw_width {

    CGRect rect = self.frame;
    rect.size.width = rw_width;
    self.frame = rect;
}

- (CGFloat)rw_width {

    return self.frame.size.width;
}

- (void)setRw_x:(CGFloat)rw_x {

    CGRect rect = self.frame;
    rect.origin.x = rw_x;
    self.frame = rect;
}

- (CGFloat)rw_x {

    return self.frame.origin.x;
}

- (void)setRw_y:(CGFloat)rw_y {

    CGRect rect = self.frame;
    rect.origin.y = rw_y;
    self.frame = rect;
}

- (CGFloat)rw_y {

    return self.frame.origin.y;
}

- (void)setRw_centerX:(CGFloat)rw_centerX {
    
    CGPoint center = self.center;
    center.x = rw_centerX;
    self.center = center;
}

- (CGFloat)rw_centerX
{
    return self.center.x;
}

- (void)setRw_centerY:(CGFloat)rw_centerY
{
    CGPoint center = self.center;
    center.y = rw_centerY;
    self.center = center;
}

- (CGFloat)rw_centerY
{
    return self.center.y;
}

@end
